package homework.valid.validators;

import java.io.IOException;
import java.io.OutputStream;

public abstract class BaseValidator implements Validator {

    private String msg;

    public BaseValidator(String msg) {
        this.msg = msg;
    }

    public String getMessage() {
        return msg;
    }

    public void printMessage(OutputStream out) throws IOException {
        out.write((msg+"\n").getBytes());
    }

    public void printMessage() {
        System.out.println(msg);
    }
}
